<include file="Public/head"/>
<script type="text/javascript" language="javascript" src="__PUBLIC__/admin/js/eye-base.js"></script>
<script type="text/javascript" language="javascript" src="__PUBLIC__/admin/js/eye-all.js"></script>
<body>
<form action="" id="listform">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> {:L("dingdanliebiao")}</strong></div>
        <div class="padding border-bottom">
            <ul class="search" style="padding-left:10px;">
                <li><a class="button border-main icon-plus-square-o" href="{:U('order/edit')}"> {:L("tianjia")}</a></li>
                <li>{:L("sousuo")}：</li>
                <li>
                    <input type="text" placeholder="{:L('qingshuru')}{:L('yonghuming')}" name="user_name"
                           value="{$get['user_name']}" class="input"
                           style="width:250px; line-height:17px;display:inline-block"/>
                </li>
                <li>
                    <input type="text" placeholder="{:L('qingshuru')}{:L('dingdanhao')}" name="order_number"
                           value="{$get['order_number']}" class="input"
                           style="width:250px; line-height:17px;display:inline-block"/>
                </li>
                <li>{:L("shijianfanwei")}：</li>
                <li><input class="input" type="text" name="start_time" value="{$get['start_time']}"
                           onClick="eye.datePicker.show(this);"/></li>
                <li>~</li>
                <li><input class="input" type="text" name="end_time" value="{$get['end_time']}"
                           onClick="eye.datePicker.show(this);"/></li>
                <li><input type="submit" value="{:L('sousuo')}" class="button border-main icon-search"/></li>
            </ul>
        </div>
        <table class="table table-hover text-center">
            <tr>
                <th width="300">{:L("yonghuming")}</th>
                <th>{:L("dingdanhao")}</th>
                <th>{:L("dingdanhaoshangpin")}</th>
                <th>{:L("xiadanshijian")}</th>
                <th>{:L("chengjiaojine")}</th>
                <th>{:L("canzhuohao")}</th>
                <th>{:L("zhuangtai")}</th>

                <th width="200">{:L("caozuo")}</th>
            </tr>
            <foreach name="list" item="v">
                <tr class="tr{$v['id']}">
                    <td>{$v['nick_name']}</td>
                    <td>{$v['order_number']}</td>
                    <td>{$v['goods_option_name']|default='已删除商品'}</td>
                    <td>{$v['time']|date="Y-m-d H:i",###}</td>
                    <td>{$v['pay_money']|default='--'}</td>
                    <td>{$v['table_number']}</td>
                    <td>
                        <if condition="$v['pay_status'] == 1">
                            <span style="color: blue; cursor: pointer; text-decoration: underline;"
                                  onclick="is_pay({$v['id']},this)">{:L("weifukuan")}</span>
                            <elseif condition="$v['pay_status'] == 2"/>
                            <span style="color: green;">{:L("yifukuan")}</span>
                            <elseif condition="$v['pay_status'] == 3"/>
                            <span>{:L("yituikuan")}</span>
                            <elseif condition="$v['pay_status'] == 4"/>
                            <span style="color: red;">{:L("yishixiao")}</span>
                        </if>
                    </td>
                    <td><a class="button border-main" href="{:U('Order/edit',array('id'=>$v['id']))}"><span
                            class="icon-edit"></span> {:L("xiangqing")}</a></td>
                </tr>
            </foreach>
            <tr>
                <td colspan="10">
                    <div class="pagelist">{$page}</div>
                </td>
            </tr>
        </table>
    </div>
</form>
<script type="text/javascript">

    function is_pay(id, t) {
        if (confirm("{:L('gaiweizhifu')}")) {
            var url = "{:U('Order/is_pay')}";
            $.getJSON(url, {id: id}, function (data) {
                if (data.result == 'yes') {
                    var p = $(t).parent();
                    $(t).remove();
                    p.prepend('<span style="color: green;">{:L("yifukuan")}</span>');
                }
            })
        }
    }
</script>
</body>

</html>